package com.apiserver.data.idStrategy;


import com.apiserver.data.annotation.IdStrategy;

public class IdProviderFactory {


    public static IdProvider createIdProvider(IdStrategy idStrategy) {

        IdProvider idProvider = null;

        switch (idStrategy) {
            case AUTO_INCREMENT:
                idProvider = AutoIncrementProvider.getSingle();
                break;
            case SNOW_FLAKE:
                idProvider = SnowflakeProvider.getSingle();
                break;
            default:
                idProvider = AutoIncrementProvider.getSingle();
                break;
        }
        return idProvider;
    }


}
